<?php

	if($get_action=="debug" and $get_item=="filldb") {

		$get_action = "view";
		$get_item = "home";
		
		array_push($ctl_status,"Database populated with example data.");
	
		$team = new Team();
		$team->setId("sales");
		$team->setDescription("Sales Team");
		$team->setSortOrder(10);
		$team->save();
		$team = null;
		
		$team = new Team();
		$team->setId("marketing");
		$team->setDescription("Marketing Team");
		$team->setSortOrder(20);
		$team->save();
		$team = null;
		
		$team = new Team();
		$team->setId("development");
		$team->setDescription("Development Team");
		$team->setSortOrder(30);
		$team->save();
		$team = null;
		
		$user = new User();
		$user->setId("louisk");
		$user->setFirstName("Louis");
		$user->setLastName("King");
		$user->setPassword("password");
		$user->setLevel(100);
		$user->setEmailAddress("l.king@in-time.co.uk");
		$user->setTelMobile("07793804805");
		$user->save();
		$user = null;
		
		$user = new User();
		$user->setId("craigf");
		$user->setFirstName("Craig");
		$user->setLastName("Fordham");
		$user->setPassword("password");
		$user->setLevel(50);
		$user->setEmailAddress("c.fordham@in-time.co.uk");
		$user->setTelMobile("07123123123");
		$user->save();
		$user = null;
		
		$user = new User();
		$user->setId("dewir");
		$user->setFirstName("Dewi");
		$user->setLastName("Roberts");
		$user->setPassword("password");
		$user->setLevel(100);
		$user->setEmailAddress("d.roberts@in-time.co.uk");
		$user->setTelMobile("07123123123");
		$user->save();
		$user = null;
		
		$user = new User();
		$user->setId("kevinm");
		$user->setFirstName("Kevin");
		$user->setLastName("Mare");
		$user->setPassword("password");
		$user->setLevel(10);
		$user->setEmailAddress("k.mare@in-time.co.uk");
		$user->setTelMobile("07123123123");
		$user->save();
		$user = null;
		
		$user = new User();
		$user->setId("danm");
		$user->setFirstName("Daniel");
		$user->setLastName("McPherson");
		$user->setPassword("password");
		$user->setLevel(10);
		$user->setEmailAddress("d.mcpherson@in-time.co.uk");
		$user->setTelMobile("07123123123");
		$user->save();
		$user = null;
		
		$user = new User();
		$user->setId("davidh");
		$user->setFirstName("David");
		$user->setLastName("Hill");
		$user->setPassword("password");
		$user->setLevel(20);
		$user->setEmailAddress("d.hill@in-time.co.uk");
		$user->setTelMobile("07123123123");
		$user->save();
		$user = null;
		
		$prompt = new Prompt();
		$prompt->setName("count_sales");
		$prompt->setType("integer");
		$prompt->setTeamId("sales");
		$prompt->setLabel("Number of Sales");
		$prompt->setHelpText("Number of Sales");
		$prompt->setSortOrder(10);
		$prompt->save();
		$prompt = null;
		
		$prompt = new Prompt();
		$prompt->setName("count_bugs_fixed");
		$prompt->setType("integer");
		$prompt->setTeamId("development");
		$prompt->setLabel("Number of Bugs Fixed");
		$prompt->setHelpText("Number of Bugs Fixed");
		$prompt->setSortOrder(10);
		$prompt->save();
		$prompt = null;
		
		$prompt = new Prompt();
		$prompt->setName("count_bugs_found");
		$prompt->setType("integer");
		$prompt->setTeamId("development");
		$prompt->setLabel("Number of Bugs Found");
		$prompt->setHelpText("Number of Bugs Found");
		$prompt->setSortOrder(20);
		$prompt->save();
		$prompt = null;
		
		$prompt = new Prompt();
		$prompt->setName("count_support_calls");
		$prompt->setType("integer");
		$prompt->setTeamId("development");
		$prompt->setLabel("Number of Support Calls");
		$prompt->setHelpText("Number of Support Calls");
		$prompt->setSortOrder(30);
		$prompt->save();
		$prompt = null;
		
		$prompt = new Prompt();
		$prompt->setName("count_adverts_live");
		$prompt->setType("integer");
		$prompt->setTeamId("marketing");
		$prompt->setLabel("Number of Live Adverts");
		$prompt->setHelpText("Number of Live Adverts");
		$prompt->setSortOrder(10);
		$prompt->save();
		$prompt = null;
		
		$prompt = new Prompt();
		$prompt->setName("count_adverts_responses");
		$prompt->setType("integer");
		$prompt->setTeamId("marketing");
		$prompt->setLabel("Number of Advert Responses");
		$prompt->setHelpText("Number of Advert Responses");
		$prompt->setSortOrder(20);
		$prompt->save();
		$prompt = null;
		
		$userteam = new UserTeam();
		$userteam->setUserId("davidh");
		$userteam->setTeamId("marketing");
		$userteam->save();
		
		$userteam = new UserTeam();
		$userteam->setUserId("louisk");
		$userteam->setTeamId("development");
		$userteam->save();
		
		$userteam = new UserTeam();
		$userteam->setUserId("louisk");
		$userteam->setTeamId("sales");
		$userteam->save();
		
		$userteam = new UserTeam();
		$userteam->setUserId("craigf");
		$userteam->setTeamId("development");
		$userteam->save();
		
		$userteam = new UserTeam();
		$userteam->setUserId("dewir");
		$userteam->setTeamId("development");
		$userteam->save();
		
		$userteam = new UserTeam();
		$userteam->setUserId("danm");
		$userteam->setTeamId("sales");
		$userteam->save();
		
		$userteam = new UserTeam();
		$userteam->setUserId("danm");
		$userteam->setTeamId("marketing");
		$userteam->save();
		
		$userteam = new UserTeam();
		$userteam->setUserId("kevinm");
		$userteam->setTeamId("sales");
		$userteam->save();
		
	}

?>
